package cn.sda.leo.springStudy.service;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * \* @Description:
 * \*
 * \* @author leiSong
 * \* @create: 2021/6/22 09:24
 * \
 */
@Component
public class ScheduledService {

    @Scheduled(cron = "0/10 * * * * *")
    public void task(){
        System.out.println(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
    }
}
